/**
 * User: alesj
 * Date: 2005.3.11
 * Time: 14:51:31
 * 
 * (C) Genera Lynx d.o.o.
 */

package com.generalynx.ecos.data.types;

public abstract class StringPersistentEnum implements PersistentEnum {

    protected abstract String toStringCode();
    
    public Object toSwitchCode() {
        return toStringCode();       
    }

    public boolean equals(Object obj) {
        if (obj == null || !(obj instanceof StringPersistentEnum)) return false;
        StringPersistentEnum spe = (StringPersistentEnum)obj;
        return toStringCode().equalsIgnoreCase(spe.toString());
    }

}
